package com.derbysoft.dswitch.adapter.ihg.common.domain;

import com.derbysoft.dswitch.adapter.ihg.common.domain.support.PersistenceSupport;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import java.util.ArrayList;
import java.util.List;

@Entity
public class ChannelAuthorization extends PersistenceSupport {

    @Column(name = "derby_channel_code", nullable = false)
    private String derbyChannelCode;

    @Column(name = "iata_number", nullable = false)
    private String iataNumber;

    @Column(name = "user_name", nullable = false)
    private String userName;

    @Column(nullable = false)
    private String password;

    @Column(nullable = false, columnDefinition = "boolean")
    private boolean usable;

    @ManyToMany(fetch = FetchType.EAGER)
    private List<RatePlan> ratePlans = new ArrayList<RatePlan>();

    public List<RatePlan> getRatePlans() {
        return ratePlans;
    }

    public void setRatePlans(List<RatePlan> ratePlans) {
        this.ratePlans = ratePlans;
    }

    public String getIataNumber() {
        return iataNumber;
    }

    public void setIataNumber(String iataNumber) {
        this.iataNumber = iataNumber;
    }

    public boolean isUsable() {
        return usable;
    }

    public void setUsable(boolean usable) {
        this.usable = usable;
    }

    public String getDerbyChannelCode() {
        return derbyChannelCode;
    }

    public void setDerbyChannelCode(String derbyChannelCode) {
        this.derbyChannelCode = derbyChannelCode;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
